package com.constant;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum  WebsiteEnum {
    BBS("bbs论坛","bbs"),
    Other("其他","other");
    ;


    private String name;
    private String code;

    WebsiteEnum(String name, String code) {
        this.name = name;
        this.code = code;
    }
    public static WebsiteEnum codeOf(String code){
        for(WebsiteEnum v:values()){
            if(Objects.equals(code,v.getCode())){
                return v;
            }
        }
        return Other;
    }
}
